<?php

namespace app\index\controller\workbench;

use ShidianUtil\Thinkphp\Response\ApiResponse;
use ShidianUtil\Utils\CheckUtil;
use app\index\model\UM as UM;
use app\index\service\ConsultingOptionsServerService;
use think\APP;
use think\Request as Request;

/**
 * ConsultingOptionsServer 控制器
 * Class ConsultingOptionsServer
 * @package app\index\controller\workbench;
 * @link https://www.kancloud.cn/manual/thinkphp6_0/1037509
 * @see \app\index\validate\workbench\ConsultingOptionsServer
 */
class ConsultingOptionsServer
{
    // 请求参数
    private Request $request;

    // service
    private ConsultingOptionsServerService $service;

    public function __construct(Request $request, ConsultingOptionsServerService $consultingOptionsServerService)
    {
        $this->request = $request;
        $this->service = $consultingOptionsServerService;
    }

    /**
     * 列表
     * @param UM|null $user
     * @return ApiResponse
     * @url /workbench/consulting_options_server/index
     */
    public function index(?UM $user): ApiResponse
    {
        return ApiResponse::success($this->service->index());
    }

}
